x11: Fix initial drag cursors
authorMatthias Clasen <mclasen@redhat.com>
Sat, 26 Aug 2017 22:01:17 +0000 (18:01 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 26 Aug 2017 23:54:29 +0000 (19:54 -0400)
Under X, we were not setting the right drag cursor initially,
because at current_action == action == 0, initially. Fix this
by explicitly using the right cursor when grabbing.

gdk/x11/gdkdnd-x11.c

index 6841d0ad832787cf5ed0845e625915d0ca2044b1..dd2d280ea25b900bf44bde663009355df84ff5a4 100644 (file)
@@ -2668,6 +2668,7 @@ drag_context_grab (GdkDragContext *context)
   GdkWindow *root;
   GdkSeat *seat;
   gint keycode, i;
+  GdkCursor *cursor;
 
   if (!x11_context->ipc_window)
     return FALSE;
@@ -2682,6 +2683,9 @@ drag_context_grab (GdkDragContext *context)
 #endif
     capabilities = GDK_SEAT_CAPABILITY_ALL;
 
+  cursor = gdk_drag_get_cursor (context, x11_context->current_action);
+  g_set_object (&x11_context->cursor, cursor);
+
   if (gdk_seat_grab (seat, x11_context->ipc_window,
                      capabilities, FALSE,
                      x11_context->cursor, NULL, NULL, NULL) != GDK_GRAB_SUCCESS)